<template>
  <div id="app">
    <header v-if="$route.meta.showHeader" class="app-header">
      <van-nav-bar
        :style="{background: $route.meta.hdColor, border:  $route.meta.borderHide ? 'none' : ''}"
        :title="$route.meta.title"
        :right-text="$route.meta.rightText"
        left-arrow
        @click-left="onClickLeft"
        @click-right="onClickRight"
      />
    </header>
   
    <div
      class="wrap"
      :style="{top: $route.meta.showHeader ? '1.22667rem' : '0', bottom: $route.meta.showFoot ? '1.33333rem' : '0'}"
    >
      <div class="main">
         
        <router-view v-slot="{ Component }">
          <keep-alive :include="$store.state.keepList">
            <component :is="Component" />
          </keep-alive>
        </router-view>
        
      </div>
    </div>
  </div>
</template>
<script>


export default {
  async mounted() {

   
   
    // let url = window.location.href.split("#/");
    // Vue.prototype.$url = encodeURIComponent(window.location.href.split("#/")[0]);
   
    // let urlCooked =url[0].split("?")[1];
    // let theRequest = new Object();
  
    // if(urlCooked) {
    //   let strs = urlCooked.split("&");
		// 	for(var i = 0; i < strs.length; i ++) {
		// 		theRequest[strs[i].split("=")[0]]= strs[i].split("=")[1] ;
    //   }

    //   let fMer = theRequest && theRequest.fMer; // 商户编码
    //   this.$store.commit("saveFMer", fMer ? fMer : '');
    //   if(theRequest && theRequest.redUrl) {
    //     let url = theRequest.redUrl
    //     delete theRequest.redUrl
    //     console.log('theRequesttheRequest----',theRequest)
    //     this.$router.push({
    //       path: '/' + url,
    //       query: theRequest
    //     })
    //   }
    // }

  },
 
   watch: {
    //监视路由跳转，插入所需操作(过场动画、控制缓存)
    $route(to) {
     
      // type: 1 去掉缓存  0 添加缓存
      if(to.path == '/selectShop') {
        this.$store.commit('setKeepList', {type: 0, name: 'shopGroup'})
      }else if(to.path == '/eleActivity') {
        this.$store.commit('setKeepList', {type: 0, name: 'eleActivity'})
      }
      

    
    }
  },
  methods: {
    onClickLeft() {
      this.$router.back()

    },
    onClickRight() {

    }
  }
}
</script>

<style lang="scss">

html {
  background: #f6f6f6;
}
@media (min-width: 560px) {
  html {
    font-size: 54px;
  }
}
progress {
  -webkit-appearance: none;
  width: 100%;
  height: 20px;
  background: #ffe0e4 !important;
}

#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: left;
  color: #2c3e50;
  font-size: 28px;
  overflow: hidden;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
.app-header {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  .van-nav-bar .van-icon {
    color: #333333;
  }
}
.wrap {
  position: absolute;
  top: 0;
  width: 100%;
}
.main {
  width: 100%;
  height: 100%;
}
.foot {
  width: 100%;
  height: auto;
  position: absolute;
  bottom: 0;
  z-index: 100;
}
.app-header .van-nav-bar {
  @include border_1px(bottom);
}

.van-hairline--bottom::after {
  border-bottom-width: 0 !important;
}

.app-foot .van-tabbar {
  @include border_1px(top);
}

.van-overlay {
  z-index: 1000 !important;
}
.mobLink-wrapper {
  display: none;
}
</style>
